package com.zkt.weichat.utils;

import cn.hutool.crypto.SecureUtil;

import java.util.Arrays;

/**
 * @author 赵开泰
 * @program jc-club
 * @date 2025/3/23 01:08
 * @description 微信服务的sha1加密
 **/

public class SHA1 {
	
	public static String sha1(String token, String timestamp, String nonce) {
		String[] array = {token, timestamp, nonce};
		Arrays.sort(array);
		StringBuffer stringBuffer = new StringBuffer();
		for (int i = 0; i < array.length; i++) {
			stringBuffer.append(array[i]);
		}
		
		return SecureUtil.sha1(stringBuffer.toString());
	}
	
}